package com.eksframework.commons.core.validator;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.context.annotation.Configuration;

import javax.validation.Validator;

/**
 * 启动运行
 *
 * @author chenfenghai
 * @version: 1.0
 * @date: 2020-12-03 10:44
 */
@Configuration
public class ValidatorConfigurationStarter implements ApplicationRunner {

    @Autowired
    Validator validator;

    /**
     * 启动运行
     *
     * @param args 参数
     */
    @Override
    public void run(ApplicationArguments args) {
        EksValidator.setValidator(validator);
    }
}
